POV-Ray : Newsgroups : povray.binaries.images : NOISE BLOBS FOR THE CRESTS OF OCEAN WAVES : NOISE BLOBS FOR THE CRESTS OF OCEAN WAVES Server Time
5 Nov 2024 08:26:23 EST (-0500)
  NOISE BLOBS FOR THE CRESTS OF OCEAN WAVES  
From: Kenneth
Date: 21 Nov 2006 12:00:01
Message: <web.45632ef1a91bd327dc4a63960@news.povray.org>
Tek's recent beautiful and complex ocean wave images got me to thinking
about adding noise blobs to the tops of isosurface wave crests, to see if
the look of foam and spray could be better simulated there, to some degree.
 Certainly not a new concept. ;-) The essence of the idea involves the noise
being constrained, more or less, to only the tips of the waves, "fading in"
in intensity there. I vaguely remember seeing some POV-Ray images that may
have used this trick, but can't remember where.

An interesting question was raised, about whether the noise blobs--being
smooth by nature--would assume a "sharper" look due to the underlying sharp
wave crests. I made some tests to see what might happen; the isosurface code
is posted below.

My *quick and dirty* water waves are just triangles (from a pigment
function) bent with a cosine wave to curl over, plus noise. Good enough to
test the idea. The wave crests curl in the +z direction.  BTW, the triangle
waves aren't actually "bent"--they're SHEARED in the z direction. Every
point on the isosurface stays at the same height it began at (a limitation
of my own current understanding of function-bending.)

Just to keep things as simple as possible, the noise "appears" at a set
height, rather than being made to follow any vertical undulations (though
it does follow the wave curls, in z, to impart a wind-blown look.)

Image #1 is just a "proof of concept."
#2 is a close-up, to see what the noise blobs look like--whether they're
still blobby, or look like sharp, flattened spikes due to the triangle
waves. Looks like a cross between the two. But even seen edge-on, they
still look reasonably rounded. The noise intensity is fading in so quickly
that it seems to overwhelm the sharp triangle edge. Part of the blobbiness
appears to be out beyond the edge anyway.
#3 is with some choppy distortion laid onto the isosurface. Since both the
noise position and the gradient y texture don't move, the white "foamy"
areas happen to correspond to the noise blobs. Interesting!

Unfortuntely, every value in my noise_compressor function is critical, due
to the exponent behavior. The values have to be finessed, to constrain and
position the noise *just so.* I'm still not satisfied with the final look;
needs more tweaking.

The contained_by box's upper y dimension is also critical, to keep the noise
from quickly fading back in above the waves (a result of the way the
noise_compressor function is currently built.) That might(?) be a problem
for more complex water waves. But there are methods of using the underlying
water-wave function(s) to make the noise follow any changes in wave
height...so the contained-by box size may not be a problem. But right now,
there IS an abrupt (and probably apparent) cut-off of the noise right above
the wave tips. I'm still experimenting to find a way around that.

What I see a need for--just from this basic experiment--is to scale the SIZE
of the noise blobs in the +y direction, larger to smaller. The result would
be a two-fold improvement, I believe: to make the noise larger and smoother
as it *approaches* the wave tips; but then tiny and more pronounced AT the
tips. Given a set noise intensity in the noise_compressor function.  But I
don't yet know how to variably scale a function's "size" across space. :-(

Does the blobby effect add realism?  That's...a good question.  I kind of
like it. With some good water waves and textures...?

Here's the isosurface code, for image #1. If anyone is interested, I'd be
glad to "deconstruct" the various functions, as to what they do (though I'm
still learning the finer points of functions myself.) I'm sure they could be
improved.

Comments, critiques, suggestions--all welcome. This is definitely a learning
experience!

Ken Walker

-----------
#include "functions.inc"

#local triangle_waves =
function{
pigment{
gradient z
triangle_wave
color_map{
[0.0 rgb 0]
[1.0 rgb 1]
}
scale .35
}
}

#local wave_bender =
function(y){.13*cos(11*y - 1.9) + .6};

#local noise_compressor =
function(y){775*pow(y + .390,30)};

isosurface{
function{
y - .3
+ triangle_waves(x,y,z + wave_bender(y)).gray*.13
- f_noise3d(150*x,100*y,100*(z + wave_bender(y)))*noise_compressor(y)
}
threshold 0
max_gradient 6.3
accuracy .00001
contained_by{box{<0,0,-.6>,<1.2,.328,3>}}
}


Post a reply to this message


Attachments:
Download 'noisy_waves.jpg' (261 KB)

Preview of image 'noisy_waves.jpg'
noisy_waves.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.